<?php

namespace App\Console;

use App\Console\Commands\CarBrandsStatistics;
use App\Console\Commands\CarOwner;
use App\Console\Commands\CarOwnerStatistics;
use App\Console\Commands\DealerScoreStat;
use App\Console\Commands\DealerTypeStat;
use App\Console\Commands\DistributionsStatistics;
use App\Console\Commands\PushStoreInfo;
use App\Console\Commands\ReadExcel;
use App\Console\Commands\ReadNewExcel;
use App\Console\Commands\RollSingleStat;
use App\Console\Commands\RollsStatistics;
use App\Console\Commands\SalesStatistics;
use App\Console\Commands\UpdateStoreCode;
use App\Console\Commands\UpdateWarrantyTime;
use App\Console\Commands\UploadPictureToAliOss;
use App\Console\Commands\WarrantyStatistics;
use App\Console\Commands\StockStat;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        SalesStatistics::class,
        RollsStatistics::class,
        CarOwner::class,
        CarBrandsStatistics::class,
        WarrantyStatistics::class,
        DistributionsStatistics::class,
        DealerScoreStat::class,
        DealerTypeStat::class,
        RollSingleStat::class,
        StockStat::class,
        CarOwnerStatistics::class,
        ReadExcel::class,
        ReadNewExcel::class,
        UploadPictureToAliOss::class,
        PushStoreInfo::class,
        UpdateStoreCode::class,
        UpdateWarrantyTime::class,
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        //$schedule->command('command:SalesStatistics')->dailyAt('02:00');
        //$schedule->command('command:RollsStatistics')->dailyAt('02:00');
        //$schedule->command('command:CarOwnerStat')->everyMinute();
        // $schedule->command('inspire')->hourly();
        $schedule->command('command:pushStoreData')->everyTwoHours()->withoutOverlapping();
    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }
}
